<div class="wrapper">
  <?php $this->partial('Common/mainHeader');?>

  <?php $this->partial('Common/mainSiderbar');?>

<div class="content-wrapper">
  <section class="content-header">
    <h1>服务中心</h1>
      <ol class="breadcrumb">
        <li><a href="/"><i class="fa fa-fw fa-home"></i> 首页</a></li>
        <li><a href="javascript:void(0);">团队推荐</a></li>
        <li class="active">服务中心</li>
      </ol>
  </section>

  <div class="content">
    <div class="row">
      <div class="col-md-6" style="margin:auto;float: none;">
        <div class="clear_f"></div>
        <div class="modal-content">
          <form role="form" action="/service/center" method="post" class="form-horizontal">
            <div class="modal-header"><h4 class="modal-title">申请服务中心</h4></div>
            <div class="modal-body">
              <div class="form-group">
                <label class="col-sm-2 control-label">申请服务中心：</label>
                <div class="col-sm-10">
                  <input type="text" class="form-control" value="<?php echo $currentUser['real_name'] . $currentUser['user_code']; ?>" readonly>
                  <input type="hidden" name="user_id" value="<?php echo $currentUser['user_id']; ?>"/>
                </div>
              </div>

              <div class="form-group">
                <label class="col-sm-2 control-label">申请人：</label>
                <div class="col-sm-10"><input type="text" class="form-control" value="<?php echo $userShop -> real_name; ?>" placeholder="姓名" readonly/></div>
              </div>

              <div class="form-group">
                <label class="col-sm-2 control-label">申请店铺类型：</label>
                <div class="col-sm-10">
                  <select class="form-control" disabled>
                    <option <?php echo $userShop -> shop_level == 2?'selected':''; ?>>代理</option>
                    <option <?php echo $userShop -> shop_level == 3?'selected':''; ?>>店代理</option>
                  </select>
                </div>
              </div>

              <div class="form-group">
                <label class="col-sm-2 control-label">联系方式：</label>
                <div class="col-sm-10"><input type="text" class="form-control" value="<?php echo $userShop -> real_name; ?>" placeholder="电话" readonly/></div>
              </div>

              <div class="form-group">
                <label class="col-sm-2 control-label">地址</label>
                <div class="col-sm-10 row" id="selectAddress">
                  <div class="col-sm-4"><select name="province_code" class="form-control" disabled></select></div>
                  <div class="col-sm-4"><select name="city_code" class="form-control" disabled></select></div>
                  <div class="col-sm-4"><select name="district_code" class="form-control" disabled></select></div>
                </div>
              </div>

              <div class="form-group">
                <label class="col-sm-2 control-label">详细地址：</label>
                <div class="col-sm-10"><input type="text" class="form-control" value="<?php echo $userShop -> address_detail; ?>" readonly/></div>
              </div>
            </div>

            <div class="modal-footer"><button type="button" class="btn btn-danger" disabled>审核中</button></div>
          </form>
        </div>
      </div>
    </div>
  </div>
</div>

  <?php $this->partial('Common/mainFooter');?>
</div>

<?php $this->partial('Common/mainScript');?>
<script type="text/javascript" charset="utf-8" src="/node_modules/distpicker/dist/distpicker.min.js"></script>
<script type="text/javascript">
  $.fn.distpicker.setDefaults({
    valueType: "code"
  });

  var addressCode = "<?php echo $userShop -> address_code; ?>",
      addressCodeJson;

  if(addressCode.toString() !== '0') {
    addressCodeJson = {
      province: addressCode.substr(0,2)+'0000',
      city: addressCode.substr(0,4)+'00',
      district: addressCode
    };
  } else {
    addressCodeJson = {};
  }

  $("#selectAddress").distpicker(addressCodeJson);
</script>